package com.lhframework.sms.api;

import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.lhframework.sms.model.ShortMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * Created by lh on 2017/8/1.
 */

@PropertySource(value = "classpath:sms_template.properties")
public abstract class AbstractSmsSender {
    @Value("${dysmsapi.product}")
    protected String product;

    @Value("${dysmsapi.domain}")
    protected String domain;

    @Value("${dysmsapi.accessKeyId}")
    protected String accessKeyId;

    @Value("${dysmsapi.accessKeySecret}")
    protected String accessKeySecret;

    @Value("${dysmsapi.signature}")
    protected String signature;

    @Autowired
    protected Environment environment;

    public abstract SendSmsResponse send(String phone, String templateName, String templateCode, ShortMessage.Type type, Map<String, String> params);
}
